// 草稿箱列表页面
import Taro from "@tarojs/taro";
import { Button, Radio, Sticky } from "@taroify/core";
import React from "react";
import { View, Text } from "@tarojs/components";
import PageLayout from "@/layout/PageLayout";
import DraftBoxPageItem from "./DraftBoxPageItem";

const mockData = [
  {
    id: "1",
    title: "测试数据11测试数据11测试数据11测试数据11测试数据11",
    createTime: "2020-07-01",
    meetingTime: "2020-06-28",
    type: "食品销售企业",
    status: 0,
  },
  {
    id: "2",
    title: "测试数据11测试数据11测试数据11测试数据11测试数据11",
    createTime: "2020-07-01",
    meetingTime: "2020-06-28",
    type: "食品销售企业",
    status: 0,
  },
  {
    id: "3",
    title: "测试数据11测试数据11测试数据11测试数据11测试数据11",
    createTime: "2020-07-01",
    meetingTime: "2020-06-28",
    type: "食品销售企业",
    status: 0,
  },
  {
    id: "4",
    title: "测试数据11测试数据11测试数据11测试数据11测试数据11",
    createTime: "2020-07-01",
    meetingTime: "2020-06-28",
    type: "食品销售企业",
    status: 0,
  },
  {
    id: "5",
    title: "测试数据11测试数据11测试数据11测试数据11测试数据11",
    createTime: "2020-07-01",
    meetingTime: "2020-06-28",
    type: "食品销售企业",
    status: 0,
  },
];

const DraftBoxPageList: React.FC = () => {
  return (
    <View className="mt-4">
      <PageLayout>
        <View className="relative w-full h-[100vh]">
          <View className="py-2">
            <View className="text-xs">统计时间：截止到本月</View>
            <View className="text-xs">月调度上报缺失数：11/12</View>
            <View className="flex flex-row items-center mt-2 text-xs flex-nowrap">
              <View className="flex-1 text-xs">
                <Radio name="1" size={16} className="text-xs">
                  <Text className="text-sm">全选</Text>
                </Radio>
              </View>
              <View className="flex-1 text-right">
                <Button color="primary" size="mini">
                  批量提交
                </Button>
              </View>
            </View>
          </View>
          <View className="mb-[40px]">
            {mockData?.map((_item) => (
              <View
                className=""
                key={_item.id}
                onClick={() =>
                  Taro.redirectTo({
                    url: "/pages/IntelFilling/components/MonthReport/components/MonthSafelyCheck/index",
                  })
                }
              >
                <DraftBoxPageItem item={_item} />
              </View>
            ))}
          </View>
          <Sticky position="bottom" offsetBottom={20} className="px-6">
            <Button
              color="primary"
              block
              onClick={() =>
                Taro.redirectTo({
                  url: "/pages/IntelFilling/components/MonthReport/components/CompletionGuide/index",
                })
              }
            >
              点击开始检查
            </Button>
          </Sticky>
        </View>
      </PageLayout>
    </View>
  );
};

export default DraftBoxPageList;
